<?php

include('confdb.php');

$con = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db($db_name);
mysql_query("SET NAMES utf8");

$idvistuplenie = $_POST['idvistuplenie'];

$otvet = array();

if(!$con) {

die ('Ошибка подключения: '.mysql_connect_error());

} 
    
    $update = "UPDATE vistuplenie set vistuplenie_activno=0 where idvistuplenie='$idvistuplenie'";
    $up = mysql_query($update);
    
    
    if ($up) {
    
           $otvet['success'] = 1;
            
    } 
    else { $otvet['success'] = 0; }
    
    
    echo json_encode($otvet);


/*
$query = "UPDATE vistuplenie set vistuplenie_activno=0 where vistuplenie_idvistuplenie='$vistuplenie_idvistuplenie'";
$result = mysql_query($query);

echo "$result";


if($result){

    $otvet['success']=mysql_result($result,0,'vistuplenie_zaversheno');
    
}
*/
 

?>

